<template>
	<view class="content">
		<uni-section title="姓名" sub-title="" type="square">
			<view class="">{{data.name}}</view>
		</uni-section>
		<uni-section title="登录密码" sub-title="" type="square">
			<view class="">{{data.password}}</view>
		</uni-section>
		<uni-section title="学院" sub-title="" type="square">
			<view class="">{{data.department}}</view>
		</uni-section>
		<uni-section title="专业" sub-title="" type="square">
			<view class="">{{data.major}}</view>
		</uni-section>
		<uni-section title="电话" sub-title="" type="square">
			<view class="">{{data.telephone}}</view>
		</uni-section>
		<uni-section title="邮箱" sub-title="" type="square">
			<view class="">{{data.email}}</view>
		</uni-section>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: {
					"id": 2,
					"name": "胖曦",
					"password": "123",
					"email": "ls@163.com",
					"telephone": "13245643421",
					"department": "什么？我说了我去吃饭了",
					"major": "移动应用开发"
				}
			}
		},
		onLoad(opt) {
			uni.request({
				url: 'http://localhost:8090/freshmenapp/classmate/findone',
				method: 'POST',
				data: {
					"id": opt.id
				},
				success: res => {
					console.log(res);
					if (res.data.success) {
						this.data = res.data.data
						uni.showToast({
							title: '成功',
							icon: 'none'
						});
					} else {
						uni.showToast({
							title: '失败',
							icon: 'none'
						});
					}
				},
				fail: () => {
					uni.showToast({
						title: '失败',
						icon: 'none'
					});
				},
				complete: () => {}
			});
			methods: {}
		}
	}
</script>

<style>

</style>